package com.avamanager.app.service.impl;

import java.util.List;
import com.avamanager.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.avamanager.app.mapper.AppTeacherMapper;
import com.avamanager.app.domain.AppTeacher;
import com.avamanager.app.service.IAppTeacherService;

/**
 * 教师信息Service业务层处理
 * 
 * @author FenvyYe
 * @date 2022-08-24
 */
@Service
public class AppTeacherServiceImpl implements IAppTeacherService 
{
    @Autowired
    private AppTeacherMapper appTeacherMapper;

    /**
     * 查询教师信息
     * 
     * @param teacherId 教师信息主键
     * @return 教师信息
     */
    @Override
    public AppTeacher selectAppTeacherByTeacherId(Long teacherId)
    {
        return appTeacherMapper.selectAppTeacherByTeacherId(teacherId);
    }

    /**
     * 查询教师信息列表
     * 
     * @param appTeacher 教师信息
     * @return 教师信息
     */
    @Override
    public List<AppTeacher> selectAppTeacherList(AppTeacher appTeacher)
    {
        return appTeacherMapper.selectAppTeacherList(appTeacher);
    }

    /**
     * 新增教师信息
     * 
     * @param appTeacher 教师信息
     * @return 结果
     */
    @Override
    public int insertAppTeacher(AppTeacher appTeacher)
    {
        appTeacher.setCreateTime(DateUtils.getNowDate());
        return appTeacherMapper.insertAppTeacher(appTeacher);
    }

    /**
     * 修改教师信息
     * 
     * @param appTeacher 教师信息
     * @return 结果
     */
    @Override
    public int updateAppTeacher(AppTeacher appTeacher)
    {
        appTeacher.setUpdateTime(DateUtils.getNowDate());
        return appTeacherMapper.updateAppTeacher(appTeacher);
    }

    /**
     * 批量删除教师信息
     * 
     * @param teacherIds 需要删除的教师信息主键
     * @return 结果
     */
    @Override
    public int deleteAppTeacherByTeacherIds(Long[] teacherIds)
    {
        return appTeacherMapper.deleteAppTeacherByTeacherIds(teacherIds);
    }

    /**
     * 删除教师信息信息
     * 
     * @param teacherId 教师信息主键
     * @return 结果
     */
    @Override
    public int deleteAppTeacherByTeacherId(Long teacherId)
    {
        return appTeacherMapper.deleteAppTeacherByTeacherId(teacherId);
    }
}
